﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;

namespace tsgl
{
    class penaltyStayClass
    {
        public static DataTable getPenaltyStay(string borrowerId)
        {
            string str;
            if (borrowerId != "")
            {
                str = "select * from 待罚款信息 where 借阅者编号 = '" + borrowerId + "'";
            }
            else
            {
                str = "select distinct 借阅者编号,借阅者姓名 from 待罚款信息";
            }
            return bookDbClass.ExecuteDataTable(str);
        }

        public static Boolean penaltyStayDelete(string borrowerId, string bookCode)
        {
            string str = "delete from 待罚款信息 where 借阅者编号='"+borrowerId+"' and 图书条码='"+bookCode+"'";
            try
            {
                bookDbClass.ExecuteNonQurey(str);
                return true;
            }
            catch (Exception)
            {
                return false;
            }

        }


    }
}
